package com.fare.taluo.application.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.fare.taluo.core.domain.crawl.statistics.SuccessDetailTaskEntity;
import com.fare.taluo.vo.core.SuccessDetailTaskVo;
import com.fare.taluo.application.SuccessDetailTaskApplication;

@Transactional
@Scope("singleton")
@Service("successDetailTaskApplication")
public class SuccessDetailTaskApplicationImpl implements SuccessDetailTaskApplication{

	@Override
	public List<SuccessDetailTaskVo> getSuccessDetailTaskByPage() {
		// TODO Auto-generated method stub
		try {
			SuccessDetailTaskEntity sdte = new SuccessDetailTaskEntity();
			List<SuccessDetailTaskEntity> listpo = sdte.getSuccessDetailTaskByPage();
			List<SuccessDetailTaskVo> listvo =  new ArrayList<SuccessDetailTaskVo>();
			for(SuccessDetailTaskEntity sdt : listpo){
				SuccessDetailTaskVo vo = new SuccessDetailTaskVo();
				vo.setGrabchannel(sdt.getGrabchannel());
				vo.setGrabdate(sdt.getGrabdate());
				vo.setSuccessNum(sdt.getSuccessNum());
				vo.setTotal(sdt.getTotal());
				listvo.add(vo);
			}
			return listvo;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
	
}
